﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Cavans画图面板
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }


        // 创建 CircleButton_Click 方法
        private void CircleButton_Click(object sender, RoutedEventArgs e)
        {
            // 创建一个新的椭圆形状
            Ellipse circle = new Ellipse
            {
                Width = 100,
                Height = 100,
                Fill = Brushes.Red
            };
            // 设置椭圆的位置
            Canvas.SetLeft(circle, 50);
            Canvas.SetTop(circle, 50);
            // 将椭圆添加到画布中
            MyCanvas.Children.Add(circle);
        }
    }
}

    